package com.gistone.commis.mapper;

import com.gistone.commis.entity.Attendance;
import com.gistone.commis.entity.Overtime;
import com.gistone.commis.query.QueryOvertime;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface OvertimeMapper {
    int deleteByPrimaryKey(Integer overtimeId);

    int insert(Overtime record);

    int insertSelective(Overtime record);

    Overtime selectByPrimaryKey(Integer overtimeId);

    int updateByPrimaryKeySelective(Overtime record);

    int updateByPrimaryKey(Overtime record);

    List<Overtime> selectSelective(QueryOvertime overtime);



    @Select("SELECT * FROM tb_person_overtime WHERE ot_Time = #{0}")
    List<Overtime> selectByTime(Date date);

    @Select("SELECT * FROM tb_person_overtime WHERE community_id=#{0} and ot_year = #{1} and ot_month = #{2}")
    List<Overtime> selectByCommunityAndYearAndMonth(Integer id ,Integer year, Integer month);


    @Select("SELECT * FROM tb_person_overtime WHERE person_id=#{0} and ot_year = #{1} and ot_month = #{2}")
    Overtime selectByPersonAndYearAndMonth(Integer id ,Integer year, Integer month);


}